require 'crawler/youtube_crawler'
require 'rexml/document'

conditions = nil
conditions = ARGV[0] unless ARGV[0].nil?

yt = Crawler::YoutubeCrawler.new :conditions => conditions

begin
  log = yt.start_crawling {|c| p c}
  if log[:stopped] then
    delay = 50 * 60
    p "Slepping #{delay}"
    sleep delay
  end
end while (log[:stopped])

p "Finis"